// Marc Gray's PHP script (untested by us)
// use at your discretion
// (Atiq comment:) The page at http://www.zytrax.com/tech/web/mobile_ids.html' which this script reads
//(see below) also has the explanation of all UA strings and talks about various mobile browsers 
// Note this script is independent and not related to other scripts/tools in this folder. Just placed
// here as this folder has some UA related stuff.

<?php
$page = file_get_contents('http://www.zytrax.com/tech/web/mobile_ids.html');
preg_match_all('/<(p(?:re)?)[^>]*class="g-c-[ns]"[^>]*>(.*?)<\/\1>/s', $page, $m);

$agents = array();
foreach($m[2] as $agent) {
  $split = explode("\n", trim($agent));
  foreach($split as $item) {
    $agents[] = trim($item);
  }
}
// $agents now holds every user agent string, one per array index, trimmed
foreach($agents as $agent) {
 echo($agent."<br/>");
}

?>